import  jsonschema

json_data = {
    "success": True,
    "code": 10000,
    "message": "操作成功",
    "money":6.66,
    "adress":None,
    "data":{
        "name":"tom",
        "age":10
    },
    "luckyNumber":[1,2,3]
}


schema = { "type": "object",
           "properties":{
            "success": {"type":"boolean"},
            "code": {"type":"integer"},
            "message": {"type":"string"},
            "money": {"type":"number"},
            "adress": {"type":"null"},
            "data": {"type":"object",
                     "properties":{
                         "name":{"type":"string"},
                          "age":{"type":"integer"}
                                   }
                     }

                          },
            "luckyNumber": {"type":"array"},
           "required":["success","code","message","money","adress","data","luckyNumber"]
           }





res = jsonschema.validate(instance=json_data, schema=schema)
print("检查结果是：", res)
